import java.nio.ByteBuffer;

/**
 * Description： TODO
 * Author： 王多鱼
 * CreateTime： 2021/6/21 18:47
 **/
public class DirectBufferMemoryDemo {
    public static void main(String[] args) {
        System.out.println("配置的maxDirectMemory:"+(sun.misc.VM.maxDirectMemory()/(double)1024/1024)+"MB");
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //-XX:MaxDirectMemorySize=5m
        ByteBuffer bb = ByteBuffer.allocateDirect(6*1024*1024);
    }
}
